<template>
  <footer class="site-footer">
    <div class="footer-container">
      <div class="footer-section about">
        <h3>关于三毛</h3>
        <p>《三毛流浪记》是一部经典的中国动画作品，讲述了一个孤儿三毛在旧社会的流浪生活。通过三毛的经历，展现了那个时代底层人民的苦难与坚韧。</p>
      </div>
      
      <div class="footer-section links">
        <h3>快速链接</h3>
        <ul>
          <li><router-link to="/">首页</router-link></li>
          <li><router-link to="/music">音乐</router-link></li>
          <li><router-link to="/video">视频</router-link></li>
          <li><router-link to="/gallery">画廊</router-link></li>
          <li><router-link to="/about">关于</router-link></li>
        </ul>
      </div>
      
      <div class="footer-section contact">
        <h3>关注我们</h3>
        <div class="qrcode-section">
          <div class="qrcode-placeholder">
            <p>微信公众号</p>
            <div class="qrcode-image">
              <!-- 二维码图片占位符 -->
              <div class="qrcode-placeholder-icon">用微信扫</div>
            </div>
            <p class="qrcode-text">扫码关注公众号</p>
          </div>
        </div>
      </div>
    </div>
    
    <div class="footer-bottom">
      <div class="footer-container">
        <p>&copy; {{ currentYear }} 三毛流浪记官方网站 - 保留所有权利</p>
        <div class="social-links">
          <a href="#" title="微博"><i class="icon-weibo">微博</i></a>
          <a href="#" title="微信"><i class="icon-wechat">微信</i></a>
          <a href="#" title="抖音"><i class="icon-douyin">抖音</i></a>
        </div>
      </div>
    </div>
    
    <!-- 添加备案信息 -->
    <div class="footer-beian">
      <div class="footer-container">
        <div class="beian-info">
          <p class="beian-text">
            <a href="https://beian.miit.gov.cn" target="_blank" rel="noopener noreferrer" class="beian-link">
              沪ICP备12345678号
            </a>
            <span class="divider">|</span>
            <a href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=12345678" 
               target="_blank" rel="noopener noreferrer" class="beian-link">
              沪公网安备 12345678号
            </a>
          </p>
        </div>
      </div>
    </div>
  </footer>
</template>

<script setup lang="ts">
import { computed } from 'vue';

// 自动更新版权年份
const currentYear = computed(() => new Date().getFullYear());
</script>

<style scoped>
.site-footer {
  background-color: #f8f8f8;
  color: #333;
  padding-top: 40px;
  margin-top: 50px;
  border-top: 1px solid #e0e0e0;
  font-family: 'Microsoft YaHei', '微软雅黑', Arial, sans-serif;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}

.footer-section {
  flex: 1;
  min-width: 250px;
  margin-bottom: 30px;
  padding-right: 30px;
}

.footer-section h3 {
  font-size: 1.3rem;
  margin-bottom: 20px;
  color: #646cff;
  position: relative;
  padding-bottom: 10px;
  font-weight: 600;
}

.footer-section h3::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 3px;
  background-color: #646cff;
  border-radius: 2px;
}

.footer-section p {
  line-height: 1.7;
  margin-bottom: 15px;
  color: #555;
  font-size: 0.95rem;
}

.footer-section.links ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-section.links li {
  margin-bottom: 12px;
}

.footer-section.links a {
  color: #555;
  text-decoration: none;
  transition: all 0.3s ease;
  display: inline-block;
  font-size: 0.95rem;
  padding: 5px 0;
}

.footer-section.links a:hover {
  color: #646cff;
  transform: translateX(8px);
}

.footer-section.contact p {
  display: flex;
  align-items: center;
}

.footer-section.contact i {
  margin-right: 10px;
  color: #646cff;
}

/* 二维码区域样式 */
.qrcode-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 10px;
}

.qrcode-placeholder {
  text-align: center;
  padding: 15px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease;
}

.qrcode-placeholder:hover {
  transform: translateY(-5px);
}

.qrcode-image {
  width: 120px;
  height: 120px;
  margin: 15px auto;
  background: #f0f0f0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed #ccc;
}

.qrcode-placeholder-icon {
  color: #999;
  font-size: 0.9rem;
}

.qrcode-text {
  font-size: 0.9rem;
  color: #666;
  margin-top: 5px;
  margin-bottom: 0;
}

.footer-bottom {
  background-color: #f0f0f0;
  padding: 20px 0;
  font-size: 0.95rem;
  border-top: 1px solid #e0e0e0;
}

.footer-bottom .footer-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.social-links {
  display: flex;
  gap: 20px;
}

.social-links a {
  color: #555;
  transition: all 0.3s ease;
  font-size: 1rem;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 5px;
}

.social-links a:hover {
  color: #646cff;
  background-color: rgba(100, 108, 255, 0.1);
}

/* 备案信息样式 */
.footer-beian {
  background-color: #e8e8e8;
  padding: 25px 0;
  font-size: 1rem;
  border-top: 1px solid #d8d8d8;
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

.beian-info {
  text-align: center;
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1200px;
  padding: 0 20px;
}

.beian-text {
  margin: 0;
  line-height: 1.8;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

.divider {
  color: #999;
  font-weight: bold;
  animation: pulse 2s infinite;
}

.beian-link {
  color: #555;
  text-decoration: none;
  transition: all 0.4s ease;
  padding: 8px 15px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.6);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
  font-weight: 500;
}

.beian-link::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transition: 0.5s;
}

.beian-link:hover {
  color: #646cff;
  background: rgba(100, 108, 255, 0.1);
  transform: translateY(-3px);
  box-shadow: 0 6px 15px rgba(100, 108, 255, 0.2);
}

.beian-link:hover::before {
  left: 100%;
}

/* 动画关键帧 */
@keyframes rotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes gradient {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes pulse {
  0% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.6;
  }
}

/* 为深色模式做准备 */
body.dark-mode .site-footer {
  background-color: #222;
  color: #f8f8f8;
  border-top: 1px solid #333;
}

body.dark-mode .footer-section p,
body.dark-mode .footer-section.links a {
  color: #ccc;
}

body.dark-mode .footer-bottom {
  background-color: #1a1a1a;
  border-top: 1px solid #333;
}

body.dark-mode .social-links a {
  color: #ccc;
}

body.dark-mode .footer-beian {
  background-color: #1a1a1a;
  border-top: 1px solid #333;
}

body.dark-mode .footer-beian a {
  color: #ccc;
}

body.dark-mode .qrcode-placeholder {
  background: #333;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

body.dark-mode .qrcode-image {
  background: #444;
  border: 1px dashed #666;
}

body.dark-mode .qrcode-placeholder-icon,
body.dark-mode .qrcode-text {
  color: #aaa;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .footer-container {
    flex-direction: column;
  }
  
  .footer-section {
    width: 100%;
    padding-right: 0;
    margin-bottom: 30px;
  }
  
  .footer-bottom .footer-container {
    flex-direction: column;
    text-align: center;
    gap: 15px;
  }
  
  .social-links {
    margin-top: 10px;
    justify-content: center;
  }
  
  .footer-beian {
    padding: 20px 0;
  }
  
  .beian-info {
    padding: 0 15px;
  }
  
  .beian-text {
    flex-direction: column;
    gap: 10px;
  }
  
  .divider {
    display: none;
  }
}

@media (max-width: 480px) {
  .beian-link {
    padding: 6px 12px;
    font-size: 0.9rem;
  }
  
  .footer-beian {
    padding: 15px 0;
  }
}
</style>